<template>
  <div>
    <input type="text" v-if="flag" v-as />
    <button @click="fn" v-else>{{ ss }}</button>
  </div>
</template>
<script>
export default {
  directives: {
    'as': {
      inserted (el) {
        el.focus()
      }
    }
  },
  name: '',
  props: {
    ss: {
      type: String
    }
  },
  data () {
    return {
      flag: false
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    fn () {
      this.flag = true
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
